﻿using Ndns.ServerHost.Abstractions;
using System.Collections.Generic;
using Ndns.Packet.Abstractions;

namespace Ndns.ServerHost
{
    class DnsResponseImpl : DnsResponse
    {

        public DnsResponseImpl()
        {
            AnswerRRs = new List<DnsResourceRecord>();
            AuthoritativeNSs = new List<DnsResourceRecord>();
            AdditionalRRs = new List<DnsResourceRecord>();
        }

        private DnsContext _context;
        internal void SetContext(DnsContext context)
        {
            _context = context;
        }

        public override DnsContext DnsContext => _context;

        public override bool ServerAuthoritative { get; set; }
        public override bool RecursionAvailable { get; set; }
        public override bool AnswerAuthenticated { get; set; }
        public override DnsReplyCode ReplyCode { get; set; }

        public override IList<DnsResourceRecord> AnswerRRs { get; }

        public override IList<DnsResourceRecord> AuthoritativeNSs { get; }

        public override IList<DnsResourceRecord> AdditionalRRs { get; }
        
        public override bool IgnoreRequest { get; set; }
    }
}
